/*
 * BuffTimeResource.h
 *
 *  Created on: 2014. 1. 14.
 *      Author: mega
 */

#ifndef BUFFTIMERESOURCE_H_
#define BUFFTIMERESOURCE_H_

#include <vector>
#include <map>

namespace ProjectZ { namespace NResource {

class BuffTimeResource
{
public:
	class BuffTimeData
	{
	public:
		struct Flyweight
		{
			int _MINUTE;
			int _RATE;
		};

	public:
		typedef std::vector<Flyweight *>			FLYWEIGHTVECTOR;
		typedef std::map<int, FLYWEIGHTVECTOR>		BUFFTIMEMAP;

	public:
		BuffTimeData();
		virtual ~BuffTimeData();

		bool				LoadResource(int company, int salecode);
		FLYWEIGHTVECTOR &	GetFlyVector(int buffType);

	private:
		void	Clear();
		void	PrintBuffTime(int company, int salecode);

	private:
		BUFFTIMEMAP		clsBuffTimeMap;
	};

public:
	enum BuffType
	{
		EM_WINPOINT_BUFF	= 0,	// 승점 버프
		EM_GUILD_BUFF,				// 길드 버프
	};


public:
	BuffTimeResource();
	virtual ~BuffTimeResource();

	bool	LoadResource();
	int		GetWinPointBuffContinueMinute(User * pUser);

private:
	BuffTimeData	* GetBuffTimeDataPtr(User * pUser);

private:
	BuffTimeData	* pBuffTimeAD;
	BuffTimeData	* pBuffTimeIOS;

};

} /*NResource*/ } /*ProjectZ*/


#endif /* BUFFTIMERESOURCE_H_ */
